package com.jl.core.controller;

import com.jl.config.BaseResponse;
import com.jl.core.util.file.FileUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("file")
@Slf4j
@Api(description = "文件")
public class FileController {

    private String path = "D:\\免责声明书.docx";

    @GetMapping("download")
    @ApiOperation(value = "下载app")
    public BaseResponse download(@RequestParam(value = "type")Integer tyep, HttpServletResponse response) throws Exception {
        FileUtil.downFile(path,response);
        return BaseResponse.success();
    }
}
